
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.9)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace TA.BE
{
	public class _SHIFT : SqlClientEntity
	{
		public _SHIFT()
		{
			this.QuerySource = "SHIFT";
			this.MappingName = "SHIFT";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_SHIFTLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int ID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.ID, ID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_SHIFTLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static SqlParameter ID
			{
				get
				{
					return new SqlParameter("@ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter NAME
			{
				get
				{
					return new SqlParameter("@NAME", SqlDbType.VarChar, 50);
				}
			}
			
			public static SqlParameter TIME_IN
			{
				get
				{
					return new SqlParameter("@TIME_IN", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter TIME_OUT
			{
				get
				{
					return new SqlParameter("@TIME_OUT", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter MIN_REGISTRATION
			{
				get
				{
					return new SqlParameter("@MIN_REGISTRATION", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter MAX_REGISTRATION
			{
				get
				{
					return new SqlParameter("@MAX_REGISTRATION", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter LIMIT_REGISTRATION
			{
				get
				{
					return new SqlParameter("@LIMIT_REGISTRATION", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter LIMIT_MAX_REGISTRATION
			{
				get
				{
					return new SqlParameter("@LIMIT_MAX_REGISTRATION", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter START_BREAK_TIME
			{
				get
				{
					return new SqlParameter("@START_BREAK_TIME", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter START_OVER_TIME
			{
				get
				{
					return new SqlParameter("@START_OVER_TIME", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter END_OVER_TIME
			{
				get
				{
					return new SqlParameter("@END_OVER_TIME", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter CREATE_DATE
			{
				get
				{
					return new SqlParameter("@CREATE_DATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter CREATE_BY
			{
				get
				{
					return new SqlParameter("@CREATE_BY", SqlDbType.VarChar, 50);
				}
			}
			
			public static SqlParameter UPDATE_DATE
			{
				get
				{
					return new SqlParameter("@UPDATE_DATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter UPDATE_BY
			{
				get
				{
					return new SqlParameter("@UPDATE_BY", SqlDbType.VarChar, 50);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string ID = "ID";
            public const string NAME = "NAME";
            public const string TIME_IN = "TIME_IN";
            public const string TIME_OUT = "TIME_OUT";
            public const string MIN_REGISTRATION = "MIN_REGISTRATION";
            public const string MAX_REGISTRATION = "MAX_REGISTRATION";
            public const string LIMIT_REGISTRATION = "LIMIT_REGISTRATION";
            public const string LIMIT_MAX_REGISTRATION = "LIMIT_MAX_REGISTRATION";
            public const string START_BREAK_TIME = "START_BREAK_TIME";
            public const string START_OVER_TIME = "START_OVER_TIME";
            public const string END_OVER_TIME = "END_OVER_TIME";
            public const string CREATE_DATE = "CREATE_DATE";
            public const string CREATE_BY = "CREATE_BY";
            public const string UPDATE_DATE = "UPDATE_DATE";
            public const string UPDATE_BY = "UPDATE_BY";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _SHIFT.PropertyNames.ID;
					ht[NAME] = _SHIFT.PropertyNames.NAME;
					ht[TIME_IN] = _SHIFT.PropertyNames.TIME_IN;
					ht[TIME_OUT] = _SHIFT.PropertyNames.TIME_OUT;
					ht[MIN_REGISTRATION] = _SHIFT.PropertyNames.MIN_REGISTRATION;
					ht[MAX_REGISTRATION] = _SHIFT.PropertyNames.MAX_REGISTRATION;
					ht[LIMIT_REGISTRATION] = _SHIFT.PropertyNames.LIMIT_REGISTRATION;
					ht[LIMIT_MAX_REGISTRATION] = _SHIFT.PropertyNames.LIMIT_MAX_REGISTRATION;
					ht[START_BREAK_TIME] = _SHIFT.PropertyNames.START_BREAK_TIME;
					ht[START_OVER_TIME] = _SHIFT.PropertyNames.START_OVER_TIME;
					ht[END_OVER_TIME] = _SHIFT.PropertyNames.END_OVER_TIME;
					ht[CREATE_DATE] = _SHIFT.PropertyNames.CREATE_DATE;
					ht[CREATE_BY] = _SHIFT.PropertyNames.CREATE_BY;
					ht[UPDATE_DATE] = _SHIFT.PropertyNames.UPDATE_DATE;
					ht[UPDATE_BY] = _SHIFT.PropertyNames.UPDATE_BY;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string ID = "ID";
            public const string NAME = "NAME";
            public const string TIME_IN = "TIME_IN";
            public const string TIME_OUT = "TIME_OUT";
            public const string MIN_REGISTRATION = "MIN_REGISTRATION";
            public const string MAX_REGISTRATION = "MAX_REGISTRATION";
            public const string LIMIT_REGISTRATION = "LIMIT_REGISTRATION";
            public const string LIMIT_MAX_REGISTRATION = "LIMIT_MAX_REGISTRATION";
            public const string START_BREAK_TIME = "START_BREAK_TIME";
            public const string START_OVER_TIME = "START_OVER_TIME";
            public const string END_OVER_TIME = "END_OVER_TIME";
            public const string CREATE_DATE = "CREATE_DATE";
            public const string CREATE_BY = "CREATE_BY";
            public const string UPDATE_DATE = "UPDATE_DATE";
            public const string UPDATE_BY = "UPDATE_BY";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _SHIFT.ColumnNames.ID;
					ht[NAME] = _SHIFT.ColumnNames.NAME;
					ht[TIME_IN] = _SHIFT.ColumnNames.TIME_IN;
					ht[TIME_OUT] = _SHIFT.ColumnNames.TIME_OUT;
					ht[MIN_REGISTRATION] = _SHIFT.ColumnNames.MIN_REGISTRATION;
					ht[MAX_REGISTRATION] = _SHIFT.ColumnNames.MAX_REGISTRATION;
					ht[LIMIT_REGISTRATION] = _SHIFT.ColumnNames.LIMIT_REGISTRATION;
					ht[LIMIT_MAX_REGISTRATION] = _SHIFT.ColumnNames.LIMIT_MAX_REGISTRATION;
					ht[START_BREAK_TIME] = _SHIFT.ColumnNames.START_BREAK_TIME;
					ht[START_OVER_TIME] = _SHIFT.ColumnNames.START_OVER_TIME;
					ht[END_OVER_TIME] = _SHIFT.ColumnNames.END_OVER_TIME;
					ht[CREATE_DATE] = _SHIFT.ColumnNames.CREATE_DATE;
					ht[CREATE_BY] = _SHIFT.ColumnNames.CREATE_BY;
					ht[UPDATE_DATE] = _SHIFT.ColumnNames.UPDATE_DATE;
					ht[UPDATE_BY] = _SHIFT.ColumnNames.UPDATE_BY;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string ID = "s_ID";
            public const string NAME = "s_NAME";
            public const string TIME_IN = "s_TIME_IN";
            public const string TIME_OUT = "s_TIME_OUT";
            public const string MIN_REGISTRATION = "s_MIN_REGISTRATION";
            public const string MAX_REGISTRATION = "s_MAX_REGISTRATION";
            public const string LIMIT_REGISTRATION = "s_LIMIT_REGISTRATION";
            public const string LIMIT_MAX_REGISTRATION = "s_LIMIT_MAX_REGISTRATION";
            public const string START_BREAK_TIME = "s_START_BREAK_TIME";
            public const string START_OVER_TIME = "s_START_OVER_TIME";
            public const string END_OVER_TIME = "s_END_OVER_TIME";
            public const string CREATE_DATE = "s_CREATE_DATE";
            public const string CREATE_BY = "s_CREATE_BY";
            public const string UPDATE_DATE = "s_UPDATE_DATE";
            public const string UPDATE_BY = "s_UPDATE_BY";

		}
		#endregion		
		
		#region Properties
	
		public virtual int ID
	    {
			get
	        {
				return base.Getint(ColumnNames.ID);
			}
			set
	        {
				base.Setint(ColumnNames.ID, value);
			}
		}

		public virtual string NAME
	    {
			get
	        {
				return base.Getstring(ColumnNames.NAME);
			}
			set
	        {
				base.Setstring(ColumnNames.NAME, value);
			}
		}

		public virtual DateTime TIME_IN
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.TIME_IN);
			}
			set
	        {
				base.SetDateTime(ColumnNames.TIME_IN, value);
			}
		}

		public virtual DateTime TIME_OUT
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.TIME_OUT);
			}
			set
	        {
				base.SetDateTime(ColumnNames.TIME_OUT, value);
			}
		}

		public virtual DateTime MIN_REGISTRATION
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.MIN_REGISTRATION);
			}
			set
	        {
				base.SetDateTime(ColumnNames.MIN_REGISTRATION, value);
			}
		}

		public virtual DateTime MAX_REGISTRATION
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.MAX_REGISTRATION);
			}
			set
	        {
				base.SetDateTime(ColumnNames.MAX_REGISTRATION, value);
			}
		}

		public virtual bool LIMIT_REGISTRATION
	    {
			get
	        {
				return base.Getbool(ColumnNames.LIMIT_REGISTRATION);
			}
			set
	        {
				base.Setbool(ColumnNames.LIMIT_REGISTRATION, value);
			}
		}

		public virtual DateTime LIMIT_MAX_REGISTRATION
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.LIMIT_MAX_REGISTRATION);
			}
			set
	        {
				base.SetDateTime(ColumnNames.LIMIT_MAX_REGISTRATION, value);
			}
		}

		public virtual DateTime START_BREAK_TIME
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.START_BREAK_TIME);
			}
			set
	        {
				base.SetDateTime(ColumnNames.START_BREAK_TIME, value);
			}
		}

		public virtual DateTime START_OVER_TIME
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.START_OVER_TIME);
			}
			set
	        {
				base.SetDateTime(ColumnNames.START_OVER_TIME, value);
			}
		}

		public virtual DateTime END_OVER_TIME
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.END_OVER_TIME);
			}
			set
	        {
				base.SetDateTime(ColumnNames.END_OVER_TIME, value);
			}
		}

		public virtual DateTime CREATE_DATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.CREATE_DATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.CREATE_DATE, value);
			}
		}

		public virtual string CREATE_BY
	    {
			get
	        {
				return base.Getstring(ColumnNames.CREATE_BY);
			}
			set
	        {
				base.Setstring(ColumnNames.CREATE_BY, value);
			}
		}

		public virtual DateTime UPDATE_DATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.UPDATE_DATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.UPDATE_DATE, value);
			}
		}

		public virtual string UPDATE_BY
	    {
			get
	        {
				return base.Getstring(ColumnNames.UPDATE_BY);
			}
			set
	        {
				base.Setstring(ColumnNames.UPDATE_BY, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ID) ? string.Empty : base.GetintAsString(ColumnNames.ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ID);
				else
					this.ID = base.SetintAsString(ColumnNames.ID, value);
			}
		}

		public virtual string s_NAME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.NAME) ? string.Empty : base.GetstringAsString(ColumnNames.NAME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.NAME);
				else
					this.NAME = base.SetstringAsString(ColumnNames.NAME, value);
			}
		}

		public virtual string s_TIME_IN
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.TIME_IN) ? string.Empty : base.GetDateTimeAsString(ColumnNames.TIME_IN);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.TIME_IN);
				else
					this.TIME_IN = base.SetDateTimeAsString(ColumnNames.TIME_IN, value);
			}
		}

		public virtual string s_TIME_OUT
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.TIME_OUT) ? string.Empty : base.GetDateTimeAsString(ColumnNames.TIME_OUT);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.TIME_OUT);
				else
					this.TIME_OUT = base.SetDateTimeAsString(ColumnNames.TIME_OUT, value);
			}
		}

		public virtual string s_MIN_REGISTRATION
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.MIN_REGISTRATION) ? string.Empty : base.GetDateTimeAsString(ColumnNames.MIN_REGISTRATION);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.MIN_REGISTRATION);
				else
					this.MIN_REGISTRATION = base.SetDateTimeAsString(ColumnNames.MIN_REGISTRATION, value);
			}
		}

		public virtual string s_MAX_REGISTRATION
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.MAX_REGISTRATION) ? string.Empty : base.GetDateTimeAsString(ColumnNames.MAX_REGISTRATION);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.MAX_REGISTRATION);
				else
					this.MAX_REGISTRATION = base.SetDateTimeAsString(ColumnNames.MAX_REGISTRATION, value);
			}
		}

		public virtual string s_LIMIT_REGISTRATION
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LIMIT_REGISTRATION) ? string.Empty : base.GetboolAsString(ColumnNames.LIMIT_REGISTRATION);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LIMIT_REGISTRATION);
				else
					this.LIMIT_REGISTRATION = base.SetboolAsString(ColumnNames.LIMIT_REGISTRATION, value);
			}
		}

		public virtual string s_LIMIT_MAX_REGISTRATION
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LIMIT_MAX_REGISTRATION) ? string.Empty : base.GetDateTimeAsString(ColumnNames.LIMIT_MAX_REGISTRATION);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LIMIT_MAX_REGISTRATION);
				else
					this.LIMIT_MAX_REGISTRATION = base.SetDateTimeAsString(ColumnNames.LIMIT_MAX_REGISTRATION, value);
			}
		}

		public virtual string s_START_BREAK_TIME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.START_BREAK_TIME) ? string.Empty : base.GetDateTimeAsString(ColumnNames.START_BREAK_TIME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.START_BREAK_TIME);
				else
					this.START_BREAK_TIME = base.SetDateTimeAsString(ColumnNames.START_BREAK_TIME, value);
			}
		}

		public virtual string s_START_OVER_TIME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.START_OVER_TIME) ? string.Empty : base.GetDateTimeAsString(ColumnNames.START_OVER_TIME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.START_OVER_TIME);
				else
					this.START_OVER_TIME = base.SetDateTimeAsString(ColumnNames.START_OVER_TIME, value);
			}
		}

		public virtual string s_END_OVER_TIME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.END_OVER_TIME) ? string.Empty : base.GetDateTimeAsString(ColumnNames.END_OVER_TIME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.END_OVER_TIME);
				else
					this.END_OVER_TIME = base.SetDateTimeAsString(ColumnNames.END_OVER_TIME, value);
			}
		}

		public virtual string s_CREATE_DATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CREATE_DATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.CREATE_DATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CREATE_DATE);
				else
					this.CREATE_DATE = base.SetDateTimeAsString(ColumnNames.CREATE_DATE, value);
			}
		}

		public virtual string s_CREATE_BY
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CREATE_BY) ? string.Empty : base.GetstringAsString(ColumnNames.CREATE_BY);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CREATE_BY);
				else
					this.CREATE_BY = base.SetstringAsString(ColumnNames.CREATE_BY, value);
			}
		}

		public virtual string s_UPDATE_DATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.UPDATE_DATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.UPDATE_DATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.UPDATE_DATE);
				else
					this.UPDATE_DATE = base.SetDateTimeAsString(ColumnNames.UPDATE_DATE, value);
			}
		}

		public virtual string s_UPDATE_BY
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.UPDATE_BY) ? string.Empty : base.GetstringAsString(ColumnNames.UPDATE_BY);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.UPDATE_BY);
				else
					this.UPDATE_BY = base.SetstringAsString(ColumnNames.UPDATE_BY, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter NAME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.NAME, Parameters.NAME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter TIME_IN
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.TIME_IN, Parameters.TIME_IN);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter TIME_OUT
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.TIME_OUT, Parameters.TIME_OUT);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter MIN_REGISTRATION
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.MIN_REGISTRATION, Parameters.MIN_REGISTRATION);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter MAX_REGISTRATION
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.MAX_REGISTRATION, Parameters.MAX_REGISTRATION);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LIMIT_REGISTRATION
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LIMIT_REGISTRATION, Parameters.LIMIT_REGISTRATION);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LIMIT_MAX_REGISTRATION
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LIMIT_MAX_REGISTRATION, Parameters.LIMIT_MAX_REGISTRATION);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter START_BREAK_TIME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.START_BREAK_TIME, Parameters.START_BREAK_TIME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter START_OVER_TIME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.START_OVER_TIME, Parameters.START_OVER_TIME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter END_OVER_TIME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.END_OVER_TIME, Parameters.END_OVER_TIME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CREATE_DATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CREATE_DATE, Parameters.CREATE_DATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CREATE_BY
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CREATE_BY, Parameters.CREATE_BY);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter UPDATE_DATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.UPDATE_DATE, Parameters.UPDATE_DATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter UPDATE_BY
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.UPDATE_BY, Parameters.UPDATE_BY);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public WhereParameter NAME
		    {
				get
		        {
					if(_NAME_W == null)
	        	    {
						_NAME_W = TearOff.NAME;
					}
					return _NAME_W;
				}
			}

			public WhereParameter TIME_IN
		    {
				get
		        {
					if(_TIME_IN_W == null)
	        	    {
						_TIME_IN_W = TearOff.TIME_IN;
					}
					return _TIME_IN_W;
				}
			}

			public WhereParameter TIME_OUT
		    {
				get
		        {
					if(_TIME_OUT_W == null)
	        	    {
						_TIME_OUT_W = TearOff.TIME_OUT;
					}
					return _TIME_OUT_W;
				}
			}

			public WhereParameter MIN_REGISTRATION
		    {
				get
		        {
					if(_MIN_REGISTRATION_W == null)
	        	    {
						_MIN_REGISTRATION_W = TearOff.MIN_REGISTRATION;
					}
					return _MIN_REGISTRATION_W;
				}
			}

			public WhereParameter MAX_REGISTRATION
		    {
				get
		        {
					if(_MAX_REGISTRATION_W == null)
	        	    {
						_MAX_REGISTRATION_W = TearOff.MAX_REGISTRATION;
					}
					return _MAX_REGISTRATION_W;
				}
			}

			public WhereParameter LIMIT_REGISTRATION
		    {
				get
		        {
					if(_LIMIT_REGISTRATION_W == null)
	        	    {
						_LIMIT_REGISTRATION_W = TearOff.LIMIT_REGISTRATION;
					}
					return _LIMIT_REGISTRATION_W;
				}
			}

			public WhereParameter LIMIT_MAX_REGISTRATION
		    {
				get
		        {
					if(_LIMIT_MAX_REGISTRATION_W == null)
	        	    {
						_LIMIT_MAX_REGISTRATION_W = TearOff.LIMIT_MAX_REGISTRATION;
					}
					return _LIMIT_MAX_REGISTRATION_W;
				}
			}

			public WhereParameter START_BREAK_TIME
		    {
				get
		        {
					if(_START_BREAK_TIME_W == null)
	        	    {
						_START_BREAK_TIME_W = TearOff.START_BREAK_TIME;
					}
					return _START_BREAK_TIME_W;
				}
			}

			public WhereParameter START_OVER_TIME
		    {
				get
		        {
					if(_START_OVER_TIME_W == null)
	        	    {
						_START_OVER_TIME_W = TearOff.START_OVER_TIME;
					}
					return _START_OVER_TIME_W;
				}
			}

			public WhereParameter END_OVER_TIME
		    {
				get
		        {
					if(_END_OVER_TIME_W == null)
	        	    {
						_END_OVER_TIME_W = TearOff.END_OVER_TIME;
					}
					return _END_OVER_TIME_W;
				}
			}

			public WhereParameter CREATE_DATE
		    {
				get
		        {
					if(_CREATE_DATE_W == null)
	        	    {
						_CREATE_DATE_W = TearOff.CREATE_DATE;
					}
					return _CREATE_DATE_W;
				}
			}

			public WhereParameter CREATE_BY
		    {
				get
		        {
					if(_CREATE_BY_W == null)
	        	    {
						_CREATE_BY_W = TearOff.CREATE_BY;
					}
					return _CREATE_BY_W;
				}
			}

			public WhereParameter UPDATE_DATE
		    {
				get
		        {
					if(_UPDATE_DATE_W == null)
	        	    {
						_UPDATE_DATE_W = TearOff.UPDATE_DATE;
					}
					return _UPDATE_DATE_W;
				}
			}

			public WhereParameter UPDATE_BY
		    {
				get
		        {
					if(_UPDATE_BY_W == null)
	        	    {
						_UPDATE_BY_W = TearOff.UPDATE_BY;
					}
					return _UPDATE_BY_W;
				}
			}

			private WhereParameter _ID_W = null;
			private WhereParameter _NAME_W = null;
			private WhereParameter _TIME_IN_W = null;
			private WhereParameter _TIME_OUT_W = null;
			private WhereParameter _MIN_REGISTRATION_W = null;
			private WhereParameter _MAX_REGISTRATION_W = null;
			private WhereParameter _LIMIT_REGISTRATION_W = null;
			private WhereParameter _LIMIT_MAX_REGISTRATION_W = null;
			private WhereParameter _START_BREAK_TIME_W = null;
			private WhereParameter _START_OVER_TIME_W = null;
			private WhereParameter _END_OVER_TIME_W = null;
			private WhereParameter _CREATE_DATE_W = null;
			private WhereParameter _CREATE_BY_W = null;
			private WhereParameter _UPDATE_DATE_W = null;
			private WhereParameter _UPDATE_BY_W = null;

			public void WhereClauseReset()
			{
				_ID_W = null;
				_NAME_W = null;
				_TIME_IN_W = null;
				_TIME_OUT_W = null;
				_MIN_REGISTRATION_W = null;
				_MAX_REGISTRATION_W = null;
				_LIMIT_REGISTRATION_W = null;
				_LIMIT_MAX_REGISTRATION_W = null;
				_START_BREAK_TIME_W = null;
				_START_OVER_TIME_W = null;
				_END_OVER_TIME_W = null;
				_CREATE_DATE_W = null;
				_CREATE_BY_W = null;
				_UPDATE_DATE_W = null;
				_UPDATE_BY_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter NAME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.NAME, Parameters.NAME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter TIME_IN
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.TIME_IN, Parameters.TIME_IN);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter TIME_OUT
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.TIME_OUT, Parameters.TIME_OUT);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter MIN_REGISTRATION
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.MIN_REGISTRATION, Parameters.MIN_REGISTRATION);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter MAX_REGISTRATION
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.MAX_REGISTRATION, Parameters.MAX_REGISTRATION);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LIMIT_REGISTRATION
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LIMIT_REGISTRATION, Parameters.LIMIT_REGISTRATION);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LIMIT_MAX_REGISTRATION
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LIMIT_MAX_REGISTRATION, Parameters.LIMIT_MAX_REGISTRATION);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter START_BREAK_TIME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.START_BREAK_TIME, Parameters.START_BREAK_TIME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter START_OVER_TIME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.START_OVER_TIME, Parameters.START_OVER_TIME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter END_OVER_TIME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.END_OVER_TIME, Parameters.END_OVER_TIME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CREATE_DATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CREATE_DATE, Parameters.CREATE_DATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CREATE_BY
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CREATE_BY, Parameters.CREATE_BY);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter UPDATE_DATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.UPDATE_DATE, Parameters.UPDATE_DATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter UPDATE_BY
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.UPDATE_BY, Parameters.UPDATE_BY);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public AggregateParameter NAME
		    {
				get
		        {
					if(_NAME_W == null)
	        	    {
						_NAME_W = TearOff.NAME;
					}
					return _NAME_W;
				}
			}

			public AggregateParameter TIME_IN
		    {
				get
		        {
					if(_TIME_IN_W == null)
	        	    {
						_TIME_IN_W = TearOff.TIME_IN;
					}
					return _TIME_IN_W;
				}
			}

			public AggregateParameter TIME_OUT
		    {
				get
		        {
					if(_TIME_OUT_W == null)
	        	    {
						_TIME_OUT_W = TearOff.TIME_OUT;
					}
					return _TIME_OUT_W;
				}
			}

			public AggregateParameter MIN_REGISTRATION
		    {
				get
		        {
					if(_MIN_REGISTRATION_W == null)
	        	    {
						_MIN_REGISTRATION_W = TearOff.MIN_REGISTRATION;
					}
					return _MIN_REGISTRATION_W;
				}
			}

			public AggregateParameter MAX_REGISTRATION
		    {
				get
		        {
					if(_MAX_REGISTRATION_W == null)
	        	    {
						_MAX_REGISTRATION_W = TearOff.MAX_REGISTRATION;
					}
					return _MAX_REGISTRATION_W;
				}
			}

			public AggregateParameter LIMIT_REGISTRATION
		    {
				get
		        {
					if(_LIMIT_REGISTRATION_W == null)
	        	    {
						_LIMIT_REGISTRATION_W = TearOff.LIMIT_REGISTRATION;
					}
					return _LIMIT_REGISTRATION_W;
				}
			}

			public AggregateParameter LIMIT_MAX_REGISTRATION
		    {
				get
		        {
					if(_LIMIT_MAX_REGISTRATION_W == null)
	        	    {
						_LIMIT_MAX_REGISTRATION_W = TearOff.LIMIT_MAX_REGISTRATION;
					}
					return _LIMIT_MAX_REGISTRATION_W;
				}
			}

			public AggregateParameter START_BREAK_TIME
		    {
				get
		        {
					if(_START_BREAK_TIME_W == null)
	        	    {
						_START_BREAK_TIME_W = TearOff.START_BREAK_TIME;
					}
					return _START_BREAK_TIME_W;
				}
			}

			public AggregateParameter START_OVER_TIME
		    {
				get
		        {
					if(_START_OVER_TIME_W == null)
	        	    {
						_START_OVER_TIME_W = TearOff.START_OVER_TIME;
					}
					return _START_OVER_TIME_W;
				}
			}

			public AggregateParameter END_OVER_TIME
		    {
				get
		        {
					if(_END_OVER_TIME_W == null)
	        	    {
						_END_OVER_TIME_W = TearOff.END_OVER_TIME;
					}
					return _END_OVER_TIME_W;
				}
			}

			public AggregateParameter CREATE_DATE
		    {
				get
		        {
					if(_CREATE_DATE_W == null)
	        	    {
						_CREATE_DATE_W = TearOff.CREATE_DATE;
					}
					return _CREATE_DATE_W;
				}
			}

			public AggregateParameter CREATE_BY
		    {
				get
		        {
					if(_CREATE_BY_W == null)
	        	    {
						_CREATE_BY_W = TearOff.CREATE_BY;
					}
					return _CREATE_BY_W;
				}
			}

			public AggregateParameter UPDATE_DATE
		    {
				get
		        {
					if(_UPDATE_DATE_W == null)
	        	    {
						_UPDATE_DATE_W = TearOff.UPDATE_DATE;
					}
					return _UPDATE_DATE_W;
				}
			}

			public AggregateParameter UPDATE_BY
		    {
				get
		        {
					if(_UPDATE_BY_W == null)
	        	    {
						_UPDATE_BY_W = TearOff.UPDATE_BY;
					}
					return _UPDATE_BY_W;
				}
			}

			private AggregateParameter _ID_W = null;
			private AggregateParameter _NAME_W = null;
			private AggregateParameter _TIME_IN_W = null;
			private AggregateParameter _TIME_OUT_W = null;
			private AggregateParameter _MIN_REGISTRATION_W = null;
			private AggregateParameter _MAX_REGISTRATION_W = null;
			private AggregateParameter _LIMIT_REGISTRATION_W = null;
			private AggregateParameter _LIMIT_MAX_REGISTRATION_W = null;
			private AggregateParameter _START_BREAK_TIME_W = null;
			private AggregateParameter _START_OVER_TIME_W = null;
			private AggregateParameter _END_OVER_TIME_W = null;
			private AggregateParameter _CREATE_DATE_W = null;
			private AggregateParameter _CREATE_BY_W = null;
			private AggregateParameter _UPDATE_DATE_W = null;
			private AggregateParameter _UPDATE_BY_W = null;

			public void AggregateClauseReset()
			{
				_ID_W = null;
				_NAME_W = null;
				_TIME_IN_W = null;
				_TIME_OUT_W = null;
				_MIN_REGISTRATION_W = null;
				_MAX_REGISTRATION_W = null;
				_LIMIT_REGISTRATION_W = null;
				_LIMIT_MAX_REGISTRATION_W = null;
				_START_BREAK_TIME_W = null;
				_START_OVER_TIME_W = null;
				_END_OVER_TIME_W = null;
				_CREATE_DATE_W = null;
				_CREATE_BY_W = null;
				_UPDATE_DATE_W = null;
				_UPDATE_BY_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SHIFTInsert]";
	
			CreateParameters(cmd);
			
			SqlParameter p;
			p = cmd.Parameters[Parameters.ID.ParameterName];
			p.Direction = ParameterDirection.Output;
    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SHIFTUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SHIFTDelete]";
	
			SqlParameter p;
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SqlCommand cmd)
		{
			SqlParameter p;
		
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.NAME);
			p.SourceColumn = ColumnNames.NAME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.TIME_IN);
			p.SourceColumn = ColumnNames.TIME_IN;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.TIME_OUT);
			p.SourceColumn = ColumnNames.TIME_OUT;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.MIN_REGISTRATION);
			p.SourceColumn = ColumnNames.MIN_REGISTRATION;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.MAX_REGISTRATION);
			p.SourceColumn = ColumnNames.MAX_REGISTRATION;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LIMIT_REGISTRATION);
			p.SourceColumn = ColumnNames.LIMIT_REGISTRATION;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LIMIT_MAX_REGISTRATION);
			p.SourceColumn = ColumnNames.LIMIT_MAX_REGISTRATION;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.START_BREAK_TIME);
			p.SourceColumn = ColumnNames.START_BREAK_TIME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.START_OVER_TIME);
			p.SourceColumn = ColumnNames.START_OVER_TIME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.END_OVER_TIME);
			p.SourceColumn = ColumnNames.END_OVER_TIME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CREATE_DATE);
			p.SourceColumn = ColumnNames.CREATE_DATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CREATE_BY);
			p.SourceColumn = ColumnNames.CREATE_BY;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.UPDATE_DATE);
			p.SourceColumn = ColumnNames.UPDATE_DATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.UPDATE_BY);
			p.SourceColumn = ColumnNames.UPDATE_BY;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
